home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
marxmenu.arc
/
NOVTRANS.MNU
< prev
next >
Wrap
Text File
|
1991-03-27
|
21KB
|
535 lines
Comment
========================================================================
Novell to MarxMenu Translator:
Copyright 1989-90 By Computer Tyme * All rights reserved.
Usage: MARXMENU NOVTRANS <novell menu>
This program was written to translate Novell menus to MarxMenus. It is
not an exact translation, but does the bulk of the work. It is up to you
to edit the output file and tune the menu the way you want.
I have made no attempt to copy color information. I am not presenting
selections in sorted order, but in the order in which they are defined.
The program creates a MarxMenu file names <menu>.TMP where <menu> is the
name of your Novell menu file. Then it compiles <menu>.TMP into
<menu>.MRX file that should be ready to run. If the menu needs to be
altered, you will have to rename the <menu>.TMP file to a .MNU file and
then you can work with it like any other MarxMenu source file.
========================================================================
EndComment
Var
NovLines Menus Tmp MenuPtr ChoicePtr CommandPtr LinePtr
BoxDim X Y Z VarNum PromptLine Out Cap InputAVar NovellFileName
MarxMenuFileName NovellTempFileName
;------ Array Positions
Qualifier MenuName YPos XPos MenuColor MenuChoices
Qualifier ChoiceName ChoiceCmd
Comment
========================================================================
This is the main body of the NovTrans Program.
========================================================================
EndComment
PreAmble
PrepareFiles
Header
Parse
WriteOutMenus
WriteOutProcedures
UseCommand Yes
ClearScreenFirst No
Execute 'MARXCOMP.EXE ' + MarxMenuFileName
Writeln
Writeln 'Done!'
Comment
========================================================================
Subroutine area.
========================================================================
EndComment
;----- Initilize Variables and Environment
Procedure PreAmble
ClearScreenOnExit Off
StandardIO
Writeln
NovellFileName = UpperCase(ParamStr(2))
Usage
EndProc
;------ Proper Usage Procedure
Procedure Usage
If NovellFileName = ''
Writeln('Usage: MarxMenu NovTrans <menu>')
Writeln('Converts Novell menus to MarxMenus.')
Writeln('Be sure to backup your original menus before running!!')
ExitMenu
EndIf
EndProc
;----- Create FileNames and open Files
Procedure PrepareFiles
If pos('.',NovellFileName) > 0
NovellFileName = left(NovellFileName,pred(pos('.',NovellFileName)))
EndIf
NovellTempFileName = NovellFileName + '.MNU'
MarxMenuFileName = ForceExtension(NovellTempFileName,'TMP')
ReadTextFile NovellTempFileName NovLines
Writeln 'Creating ' MarxMenuFileName
FileAssign(Out,MarxMenuFileName)
FileCreate(Out)
EndProc
;----- Write out the MarxMenu Source Header
Procedure Header
FileWriteln(Out,'Comment')
FileWriteln(Out,'==========================================================')
FileWriteln(Out,'')
FileWriteln(Out,'This File was converted from a Novell Menu.')
FileWriteln(Out,'It should behave in a similar way to the original menu but')
FileWriteln(Out,'not necessarilly exactly the same. It will be close enough')
FileWriteln(Out,'for you to fine tune it the way you want.')
FileWriteln(Out,'')
FileWriteln(Out,'To add a choice to a menu simply create another array element' )
FileWriteln(Out,'to Choices, then add the appropiate Onkey statement.' )
FileWriteln(Out,'The menu will make the size adjustments accordinaly.' )
FileWriteln(Out,' EX:' )
FileWriteln(Out,' Choices[10] = "Print Console" ' )
FileWriteln(Out,' ... ' )
FileWriteln(Out,' ... ' )
FileWriteln(Out,' OnKey "K" ')
FileWriteln(Out,' PConsole ' )
FileWriteln(Out,' ...' )
FileWriteln(Out,'' )
FileWriteln(Out," If you want to change the menu's center, pass the XY" )
FileWriteln(Out," coordinates to menu's MakeBox( ) procedure." )
FileWriteln(Out,' EX:' )
FileWriteln(Out,' MakeBox( "Menu Header",10,10,CenterXY ) ' )
FileWriteln(Out,' This will cause the menu to center at Col 10, Row 10 ' )
FileWriteln(Out,'' )
FileWriteln(Out,'=========================================================')
FileWriteln(Out,'EndComment')
FileWriteln(Out,'')
FileWriteln(Out,';------' )
FileWriteln(Out,';- Create Variables')
FileWriteln(Out,';------' )
FileWriteln(Out,'Var')
FileWriteln(Out,' VertLine = "┬│││││││││││││││││││││││││││││││││││││││││││││"')
FileWriteln(Out,' %NovVar1 %NovVar2 %NovVar3 %NovVar4 ')
FileWriteln(Out,' %NovVar5 %NovVar6 %NovVar7 %NovVar8 %NovVar9' )
FileWriteln(Out,' Choices' )
FileWriteln(Out,' MenuTitle' )
FileWriteln(Out,' StatusLineText' )
FileWriteln(Out,' BackGroundFG BackGroundBG' )
FileWriteln(Out,' TitleBoxBorderFG TitleBoxBorderBG' )
FileWriteln(Out,' TitleBoxInsideFG TitleBoxInsideBG' )
FileWriteln(Out,' ClockColorFG ClockColorBG' )
FileWriteln(Out,' StatusLineFG StatusLineBG' )
FileWriteln(Out,' MenuInsideFG MenuInsideBG' )
FileWriteln(Out,' MenuHeaderFG MenuHeaderBG' )
FileWriteln(Out,' MenuBorderFG MenuBorderBG' )
FileWriteln(Out,' MenuVertLinesFG MenuVertLinesBG' )
FileWriteln(Out,' MenuInverseFG MenuInverseBG' )
FileWriteln(Out,' MenuCapColorFG MenuCapColorBG' )
FileWriteln(Out,'' )
FileWriteln(Out,';------' )
FileWriteln(Out,';- Create Constants' )
FileWriteln(Out,';------' )
FileWriteln(Out,'Const' )
FileWriteln(Out,' CornerXY = 1' )
FileWriteln(Out,' CenterXY = 0' )
FileWriteln(Out,'' )
FileWriteln(Out,' ;Here is where you add you own menu title and status line message' )
FileWriteln(Out,'MenuTitle = "MarxMenu System" ' )
FileWriteln(Out,'StatusLineText = "(C) Copyright 1990 Computer Tyme * All rights reserved"' )
FileWriteln(Out,'' )
FileWriteln(Out,';------')
FileWriteln(Out,';- Select colors and prepare screen')
FileWriteln(Out,';------' )
FileWriteln(Out,'SavePosition On')
FileWriteln(Out,'')
FileWriteln(Out,' ;This is where you can change the colors to suit your taste.')
FileWriteln(Out,'If ColorScreen')
FileWriteln(Out,' ;Color ColorSet' )
FileWriteln(Out,' BackGroundFG = Cyan' )
FileWriteln(Out,' BackGroundBG = Blue' )
FileWriteln(Out,' TitleBoxBorderFG = Blue' )
FileWriteln(Out,' TitleBoxBorderBG = Cyan' )
FileWriteln(Out,' TitleBoxInsideFG = Blue' )
FileWriteln(Out,' TitleBoxInsideBG = Cyan' )
FileWriteln(Out,' ClockColorFG = Blue' )
FileWriteln(Out,' ClockColorBG = Cyan' )
FileWriteln(Out,' StatusLineFG = Black' )
FileWriteln(Out,' StatusLineBG = Cyan' )
FileWriteln(Out,' MenuInsideFG = Yellow' )
FileWriteln(Out,' MenuInsideBG = Blue' )
FileWriteln(Out,' MenuBorderFG = Yellow' )
FileWriteln(Out,' MenuBorderBG = Blue' )
FileWriteln(Out,' MenuHeaderFG = White' )
FileWriteln(Out,' MenuHeaderBG = Blue' )
FileWriteln(Out,' MenuVertLinesFG = Green' )
FileWriteln(Out,' MenuVertLinesBG = Blue' )
FileWriteln(Out,' MenuInverseFG = White' )
FileWriteln(Out,' MenuInverseBG = Red' )
FileWriteln(Out,' MenuCapColorFG = White' )
FileWriteln(Out,' MenuCapColorBG = Blue' )
FileWriteln(Out,'else')
FileWriteln(Out,' ;Monchrome ColorSet' )
FileWriteln(Out,' BackGroundFG = White' )
FileWriteln(Out,' BackGroundBG = Black' )
FileWriteln(Out,' TitleBoxBorderFG = Black' )
FileWriteln(Out,' TitleBoxBorderBG = Grey' )
FileWriteln(Out,' TitleBoxInsideFG = Black' )
FileWriteln(Out,' TitleBoxInsideBG = Grey' )
FileWriteln(Out,' ClockColorFG = Black' )
FileWriteln(Out,' ClockColorBG = Grey' )
FileWriteln(Out,' MenuInsideFG = Grey' )
FileWriteln(Out,' MenuInsideBG = Black' )
FileWriteln(Out,' MenuBorderFG = White' )
FileWriteln(Out,' MenuBorderBG = Black' )
FileWriteln(Out,' MenuHeaderFG = White' )
FileWriteln(Out,' MenuHeaderBG = Black' )
FileWriteln(Out,' MenuVertLinesFG = Grey' )
FileWriteln(Out,' MenuVertLinesBG = Black' )
FileWriteln(Out,' MenuInverseFG = Black' )
FileWriteln(Out,' MenuInverseBG = Grey' )
FileWriteln(Out,' MenuCapColorFG = White' )
FileWriteln(Out,' MenuCapColorBG = Black' )
FileWriteln(Out,'EndIf')
FileWriteln(Out,'' )
FileWriteln(Out,' ;Clear the screen with a textured background' )
FileWriteln(Out,'TextColor BackGroundFG BackGroundBG' )
FileWriteln(Out,'ClearScreen 176' )
FileWriteln(Out,'')
FileWriteln(Out,' ;Draw Status Line' )
FileWriteln(Out,'GotoXY( 1,25 ) ')
FileWriteln(Out,'TextColor( StatusLineFG,StatusLineBG ) ' )
FileWriteln(Out,'ClearLine' )
FileWriteln(Out,'WriteCenter( StatusLineText ) ')
FileWriteln(Out,'' )
FileWriteln(Out,' ;Draw the Title Box')
FileWriteln(Out,'SingleLineBox')
FileWriteln(Out,'Explode Off')
FileWriteln(Out,'BoxInsideColor TitleBoxInsideFG TitleBoxInsideBG' )
FileWriteln(Out,'BoxBorderColor TitleBoxBorderFG TitleBoxBorderBG' )
FileWriteln(Out,'DrawBox 1 1 80 3')
FileWriteln(Out,'Write " " + MenuTitle ')
FileWriteln(Out, '' )
FileWriteln(Out,' ; Display the clock' )
FileWriteln(Out,'ClockColor ClockColorFG ClockColorBG')
FileWriteln(Out,'ClockPos 35 2')
FileWriteln(Out,'' )
FileWriteln(Out,' ;Set up the blank screen message')
FileWriteln(Out,'BlankMessage "Running ' + NovellTempFileName + '"')
FileWriteln(Out,' ;Change BlankTime to 0 if you do not want to blank the screen.' )
FileWriteln(Out,'BlankTime = 5')
FileWriteln(Out,'')
FileFlush(Out);
EndProc
;----- Delete all spaces in a string to make them a valid MarxMenu label
; Returns a string
Procedure DeleteSpaces( St )
While Pos( ' ',St ) > 0
Delete( St,Pos(' ',St ),1 )
EndWhile
Return St
EndProc
;----- Parse Novell Source into MenuName, MenuChoices, MenuCommands
Procedure Parse
Writeln( 'Parsing Novell Menu source code ...' )
MenuPtr = 0
Loop( NumberOfElements( NovLines ) )
If left(NovLines[LoopIndex],1) = '%'
ChoicePtr = 0
CommandPtr = 0
MenuPtr = MenuPtr + 1
Tmp = mid(NovLines[LoopIndex],2,255)
X = pos(',',Tmp)
If X = 0 then X = length(Tmp) + 1
Menus[MenuPtr].MenuName = ':' + left(Tmp,X - 1)
Tmp = mid(Tmp,X + 1,255)
Menus[MenuPtr].YPos = value(NextWord(Tmp))
Menus[MenuPtr].XPos = value(NextWord(Tmp))
Menus[MenuPtr].MenuColor = value(NextWord(Tmp))
else
If left(NovLines[LoopIndex],1) > ' '
CommandPtr = 0
ChoicePtr = ChoicePtr + 1
Trim( NovLines[LoopIndex] )
If Mid( NovLines[LoopIndex], 2, 1 ) = '.'
Delete( NovLines[LoopIndex],1,2 )
Trim( NovLines[LoopIndex] )
EndIf
Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceName = NovLines[LoopIndex]
else
If ChoicePtr = 0
Writeln
Writeln 'Error in menu line: ' LoopIndex
ExitMenu
EndIf
CommandPtr = CommandPtr + 1
Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd[CommandPtr] = NovLines[LoopIndex]
EndIf
EndIf
EndLoop
EndProc
;------
;- Create the Menu Choices Array
;------
Procedure WriteOutMenuChoices
Writeln('Translating: ' + mid(Menus[MenuPtr].MenuName,2,255))
FileWriteln(Out,';------' )
FileWriteln(Out,';- Translating: ' + mid(Menus[MenuPtr].MenuName,2,255))
FileWriteln(Out,';------' )
FileWriteln(Out,'')
If MenuPtr > 1
Tmp = Menus[MenuPtr].MenuName
Tmp = DeleteSpaces( Tmp )
FileWriteln(Out,Tmp)
EndIf
FileWriteln(Out,'Dispose Choices')
Loop( NumberOfElements( Menus[MenuPtr].MenuChoices ) )
FileWriteln(Out,'Choices[' + Str( LoopIndex ) + '] = " ' + Menus[MenuPtr].MenuChoices[LoopIndex].ChoiceName + '"')
EndLoop
FileWriteln(Out,'MakeBox( "' + Mid( Menus[MenuPtr].MenuName,2,255) + '",' + Str( Menus[MenuPtr].YPos ) + ',' + Str( Menus[MenuPtr].XPos ) + ',CenterXY )');
EndProc
;------
;- Create the Onkey Statements
;------
Procedure WriteOutOnkeyChoices
Loop( NumberOfElements(Menus[MenuPtr].MenuChoices) )
ChoicePtr = LoopIndex
Tmp = Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceName
FileWriteln(Out,'OnKey "' + Char( 64 + ChoicePtr ) + '"')
Loop( NumberOfElements(Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd) )
CommandPtr = LoopIndex
Tmp = Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd[CommandPtr]
Trim(Tmp)
If UpperCase(Tmp) = '!LOGOUT' then Tmp = '|LogOut'
If Left( Tmp,1 ) = '%'
Tmp = DeleteSpaces( Tmp )
Tmp = '^' + Mid( Tmp,2,255 )
EndIf
If pos('@',Tmp) > 0
X = 1
while X <= length(Tmp)
while (X <= length(Tmp)) and (mid(Tmp,X,1) <> '@')
X = X + 1
endwhile
Z[1] = mid(Tmp,X,1)
Z[2] = mid(Tmp,X + 1,1)
If (Z[1] = '@') and (((Z[2] > '0') and (Z[3] <= '9')) or (Z[2] = '"'))
If Z[2] = '"'
insert(' ',Tmp,X + 1)
VarNum = 10
else
VarNum = ord(Z[2]) - 48
EndIf
InputAVar = mid(Tmp,X + 2,1) = '"'
If InputAVar
Y = X + 3
while (mid(Tmp,Y,1) <> '"') and (Y <= length(Tmp))
Y = Y + 1
endwhile
PromptLine = mid(Tmp,X + 3,Y - (X + 3))
else
Y = X + 1
EndIf
delete(Tmp,X,Y - X + 1)
insert('%NovVar' + Str(VarNum) ,Tmp,X)
If InputAVar
FileWriteln(Out,' |%NovVar',Str( VarNum ), ' = ReadTextLine( "' + PromptLine + '" )')
EndIf
EndIf
endwhile
EndIf
FileWriteln(Out,' ' + Tmp )
EndLoop
FileWriteln(Out,'')
EndLoop
EndProc
;------
;- Create the Menus
;------
Procedure WriteOutMenus
Var LoopCount
Writeln
LoopCount = MenuPtr
Loop( LoopCount ) ;lNumberOfElements(Menus) )
MenuPtr = LoopIndex
WriteOutMenuChoices
WriteOutOnkeyChoices
If MenuPtr = 1
FileWriteln(Out,'OnKey ESC')
FileWriteln(Out,' ^Leave')
FileWriteln(Out,'')
EndIf
EndLoop
EndProc
;------
;- Create the support procedures
;------
Procedure WriteOutProcedures
FileWriteln(Out,'')
FileWriteln(Out,';------' )
FileWriteln(Out,';- Read a Text Line Procedure' )
FileWriteln(Out,';------' )
FileWriteln(Out,'Procedure ReadTextLine( St )')
FileWriteln(Out,' Var AnswerLine' )
FileWriteln(Out,' Dispose Choices' )
FileWriteln(Out,' Choices[1] = "" ' )
FileWriteln(Out,' MakeBox( "User Input",21,0,CenterXY)')
FileWriteln(Out,' Write " " St " "')
FileWriteln(Out,' TextColor( MenuCapColorFG,MenuCapColorBG )')
FileWriteln(Out,' AnswerLine = Readln')
FileWriteln(Out,' EraseTopWindow')
FileWriteln(Out,' Return AnswerLine ' )
FileWriteln(Out,'EndProc')
FileWriteln(Out,'')
FileWriteln(Out,';------' )
FileWriteln(Out,';- MenuExit Procedure')
FileWriteln(Out,';------' )
FileWriteln(Out,':Leave' )
FileWriteln(Out,' Dispose Choices' )
FileWriteln(Out,' Choices[1] = "Yes"' )
FileWriteln(Out,' Choices[2] = "No"' )
FileWriteln(Out,' MakeBox(" Exit ",0,0,CenterXY )' )
FileWriteln(Out,' OnKey "A"' )
FileWriteln(Out,' |ExitMenu' )
FileWriteln(Out,'' )
FileWriteln(Out,' OnKey "B"' )
FileWriteln(Out,' |LastKey = Esc' )
FileWriteln(Out,'' )
FileWriteln(Out,';------' )
FileWriteln(Out,';- Logout Procedure' )
FileWriteln(Out,';------' )
FileWriteln(Out,'Procedure Logout' )
FileWriteln(Out,' StuffKbd = "Logout" + CR' )
FileWriteln(Out,' ExitMenu' )
FileWriteln(Out,'EndProc' )
FileWriteln(Out,'' )
FileWriteln(Out,';------' )
FileWriteln(Out,';- This draws a menu similiar to the Novell menus' )
FileWriteln(Out,';- An 0 for Row And/Or Col, and the menu will get centered respectifly' )
FileWriteln(Out,';------' )
FileWriteln(Out,'Procedure MakeBox( HeaderST,Row,Col,XYOrgin )' )
FileWriteln(Out,'Var NumElem Height Width' )
FileWriteln(Out,'' )
FileWriteln(Out,' Width = Length( HeaderSt )' )
FileWriteln(Out,' NumElem = NumberOfElements( Choices )' )
FileWriteln(Out,' ;Get the widest element in the Choices Array' )
FileWriteln(Out,' If Length( Choices[1] ) > 0 ' )
FileWriteln(Out,' Loop NumElem' )
FileWriteln(Out,' Trim( Choices[LoopIndex] )' )
FileWriteln(Out,' Choices[LoopIndex] = " " + Char( 64 + LoopIndex ) + ". " + Choices[LoopIndex]' )
FileWriteln(Out,' Width = Max( Width,Length( Choices[LoopIndex] ) )' )
FileWriteln(Out,' EndLoop' )
FileWriteln(Out,' Else' )
FileWriteln(Out,' Width = 72 ' )
FileWriteln(Out,' EndIf' )
FileWriteln(Out,' Height = NumElem + 4' )
FileWriteln(Out,' Width = Width + 6' )
FileWriteln(Out,' If XYOrgin = CenterXY' )
FileWriteln(Out,' If Row = 0' )
FileWriteln(Out,' ;Center window verticaly' )
FileWriteln(Out,' Row = (( 25 - Height ) / 2) + 2' )
FileWriteln(Out,' Else' )
FileWriteln(Out,' ;Center window with X Coordinate' )
FileWriteln(Out,' Row = (Row - (Height / 2) + 1 )' )
FileWriteln(Out,' EndIf' )
FileWriteln(Out,' If Col = 0' )
FileWriteln(Out,' ;Center window horizonitly' )
FileWriteln(Out,' Col = ( 80 - Width) / 2' )
FileWriteln(Out,' Else' )
FileWriteln(Out,' ;Center window with Y Coordinate' )
FileWriteln(Out,' Col = (Col - ( Width / 2 ) + 1 )' )
FileWriteln(Out,' EndIf' )
FileWriteln(Out,' EndIf' )
FileWriteln(Out,' ;Make Sure Row and Col are within their range' )
FileWriteln(Out,' While Row <= 4' )
FileWriteln(Out,' Row = Row + 1' )
FileWriteln(Out,' EndWhile' )
FileWriteln(Out,' While ((Row + Height) > 24)' )
FileWriteln(Out,' Row = Row - 1' )
FileWriteln(Out,' EndWhile' )
FileWriteln(Out,' While Col <= 1' )
FileWriteln(Out,' Col = Col + 1' )
FileWriteln(Out,' EndWhile' )
FileWriteln(Out,' While ((Col + Width) > 80)' )
FileWriteln(Out,' Col = Col - 1' )
FileWriteln(Out,' EndWhile' )
FileWriteln(Out,' CreateXYBox( Col,Row,Width,Height,HeaderSt,NumElem )' )
FileWriteln(Out,'EndProc' )
FileWriteln(Out,'' )
FileWriteln(Out,';------' )
FileWriteln(Out,';- Draw the Box' )
FileWriteln(Out,';------' )
FileWriteln(Out,'Procedure CreateXYBox( Col,Row,Width,Height,HeaderSt,NumElem )' )
FileWriteln(Out,' ;Draw the main window' )
FileWriteln(Out,' Explode On' )
FileWriteln(Out,' DoubleLineBox' )
FileWriteln(Out,' BoxInsideColor( MenuInsideFG,MenuInsideBG )' )
FileWriteln(Out,' BoxBorderColor( MenuBorderFG,MenuBorderBG )' )
FileWriteln(Out,' DrawBox( Col, Row, Width, Height )' )
FileWriteln(Out,' ;Write the header' )
FileWriteln(Out,' TextColor( MenuHeaderFG,MenuHeaderBG )' )
FileWriteln(Out,' WriteCenter( HeaderSt )' )
FileWriteln(Out,' ;Write the vertical lines' )
FileWriteln(Out,' TextColor( MenuVertLinesFG,MenuVertLinesBG )' )
FileWriteln(Out,' Writeln' )
FileWriteln(Out,' ClearLine 196' )
FileWriteln(Out,' GotoXY 2 2' )
FileWriteln(Out,' WriteVertical mid(VertLine,1,Height - 3)' )
FileWriteln(Out,' ;Draw the menu text box' )
FileWriteln(Out,' If Choices[1] > "" ' )
FileWriteln(Out,' CapsColor( MenuCapColorFG,MenuCapColorBG )' )
FileWriteln(Out,' Else' )
FileWriteln(Out,' CapsColor( Black,Black ) ' )
FileWriteln(Out,' EndIf ' )
FileWriteln(Out,' InverseColor( MenuInverseFG,MenuInverseBG )' )
FileWriteln(Out,' Explode Off' )
FileWriteln(Out,' NoBoxBorder' )
FileWriteln(Out,' Window( Col + 3, Row + 3, Width - 4, Height - 4 )' )
FileWriteln(Out,' ;Write the menu choices' )
FileWriteln(Out,' Loop( NumElem - 1 )' )
FileWriteln(Out,' Writeln( Choices[LoopIndex] )' )
FileWriteln(Out,' EndLoop' )
FileWriteln(Out,' Write Choices[NumElem]' )
FileWriteln(Out,' UseArrows On' )
FileWriteln(Out,'EndProc ' )
FileClose(Out)
EndProc